/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;

import java.awt.Font;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.font.TextAttribute;
import java.util.Map;
import javax.swing.JPanel;

/**
 *
 * @author CHX_93
 */
public class Gui_GhiDanh_root extends javax.swing.JFrame {

    /**
     * Creates new form Gui_GhiDanh_root
     */
    public Gui_GhiDanh_root() {
        initComponents();

        lb_ghiNhanTTKH.addMouseListener(listener_mouse);
        lb_dangKiThiXepLop.addMouseListener(listener_mouse);
    }

    MouseListener listener_mouse = new MouseAdapter() {
        Font original;
        Map attributes;

        @Override
        public void mouseEntered(MouseEvent e) {
            original = e.getComponent().getFont();
            attributes = original.getAttributes();
            attributes.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
            e.getComponent().setFont(original.deriveFont(attributes));
        }

        @Override
        public void mouseExited(MouseEvent e) {
            e.getComponent().setFont(original);
        }

        @Override
        public void mousePressed(MouseEvent e) {
            String name = ((javax.swing.JLabel) e.getComponent()).getText();
            String[] nameList = new String[]{lb_ghiNhanTTKH.getText(), lb_dangKiThiXepLop.getText()};
            JPanel[] panelList = new JPanel[]{gui_GhiDanh_1, gui_GhiDanh_2};

            int i = 0;
            for (i = 0; i < nameList.length; i++) {
                if (name.equals(nameList[i])) {
                    panelList[i].show();
                    Font newFont = new Font(original.getName(), Font.BOLD, original.getSize());
                    e.getComponent().setFont(newFont);
                } else {
                    panelList[i].hide();
                }
            }
        }
    };

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel_ten = new javax.swing.JLabel();
        jPanel_root = new javax.swing.JPanel();
        lb_tenForm = new javax.swing.JLabel();
        panel_chucnang = new javax.swing.JPanel();
        lb_ghiNhanTTKH = new javax.swing.JLabel();
        lb_dangKiThiXepLop = new javax.swing.JLabel();
        lb_lapBC = new javax.swing.JLabel();
        lb_lapBC_1 = new javax.swing.JLabel();
        lb_lapBC_2 = new javax.swing.JLabel();
        btn_thoat = new javax.swing.JButton();
        panel_DSKH = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        table_KH1 = new javax.swing.JTable();
        panel_cardLayout = new javax.swing.JPanel();
        gui_GhiDanh_1 = new GUI.Gui_GhiDanh_1();
        gui_GhiDanh_2 = new GUI.Gui_GhiDanh_2();

        jLabel_ten.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        jLabel_ten.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel_ten.setText("HỌC VIÊN");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        lb_tenForm.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
        lb_tenForm.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lb_tenForm.setText("BỘ PHẬN GHI DANH");

        panel_chucnang.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Chức năng", javax.swing.border.TitledBorder.LEADING, javax.swing.border.TitledBorder.TOP));
        panel_chucnang.setAlignmentX(1.0F);
        panel_chucnang.setAlignmentY(1.0F);
        panel_chucnang.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        panel_chucnang.setMaximumSize(new java.awt.Dimension(130, 120));
        panel_chucnang.setName(""); // NOI18N
        panel_chucnang.setPreferredSize(new java.awt.Dimension(130, 120));

        lb_ghiNhanTTKH.setText("Ghi nhận thông tin khách hàng");
        lb_ghiNhanTTKH.setToolTipText("");
        lb_ghiNhanTTKH.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        lb_ghiNhanTTKH.setName("Xen thông tin cá nhân"); // NOI18N

        lb_dangKiThiXepLop.setText("Đăng kí thi xếp lớp");
        lb_dangKiThiXepLop.setToolTipText("");
        lb_dangKiThiXepLop.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        lb_dangKiThiXepLop.setName(""); // NOI18N

        lb_lapBC.setText("Lập báo cáo");
        lb_lapBC.setToolTipText("");
        lb_lapBC.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        lb_lapBC.setName("Xen học phí"); // NOI18N

        lb_lapBC_1.setLabelFor(lb_lapBC);
        lb_lapBC_1.setText("<html>Báo cáo số lần gọi điện thoại theo ngày</html>");
        lb_lapBC_1.setToolTipText("");
        lb_lapBC_1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        lb_lapBC_1.setName("Xen học phí"); // NOI18N

        lb_lapBC_2.setLabelFor(lb_lapBC);
        lb_lapBC_2.setText("<html>Báo cáo tình hình đăng kí lớp học</html>");
        lb_lapBC_2.setToolTipText("");
        lb_lapBC_2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        lb_lapBC_2.setName("Xen học phí"); // NOI18N

        javax.swing.GroupLayout panel_chucnangLayout = new javax.swing.GroupLayout(panel_chucnang);
        panel_chucnang.setLayout(panel_chucnangLayout);
        panel_chucnangLayout.setHorizontalGroup(
            panel_chucnangLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel_chucnangLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panel_chucnangLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panel_chucnangLayout.createSequentialGroup()
                        .addGroup(panel_chucnangLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lb_ghiNhanTTKH)
                            .addComponent(lb_dangKiThiXepLop)
                            .addComponent(lb_lapBC))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(panel_chucnangLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(panel_chucnangLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lb_lapBC_2, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)
                            .addComponent(lb_lapBC_1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))))
                .addContainerGap())
        );
        panel_chucnangLayout.setVerticalGroup(
            panel_chucnangLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel_chucnangLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lb_ghiNhanTTKH)
                .addGap(18, 18, 18)
                .addComponent(lb_dangKiThiXepLop)
                .addGap(18, 18, 18)
                .addComponent(lb_lapBC)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lb_lapBC_1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lb_lapBC_2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(142, Short.MAX_VALUE))
        );

        btn_thoat.setText("Thoát");

        panel_DSKH.setBorder(javax.swing.BorderFactory.createTitledBorder("Danh sách khách hàng"));

        table_KH1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null, null, null}
            },
            new String [] {
                "STT", "Mã khách hàng", "Họ tên", "Số điện thoại", "Ngày sinh", "Địa chỉ", "Giới tính", "Trình độ", "Tình trạng", "Giờ rảnh"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        jScrollPane4.setViewportView(table_KH1);

        javax.swing.GroupLayout panel_DSKHLayout = new javax.swing.GroupLayout(panel_DSKH);
        panel_DSKH.setLayout(panel_DSKHLayout);
        panel_DSKHLayout.setHorizontalGroup(
            panel_DSKHLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel_DSKHLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane4)
                .addContainerGap())
        );
        panel_DSKHLayout.setVerticalGroup(
            panel_DSKHLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panel_DSKHLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 153, Short.MAX_VALUE)
                .addContainerGap())
        );

        panel_cardLayout.setLayout(new java.awt.CardLayout());
        panel_cardLayout.add(gui_GhiDanh_1, "card2");
        panel_cardLayout.add(gui_GhiDanh_2, "card3");

        javax.swing.GroupLayout jPanel_rootLayout = new javax.swing.GroupLayout(jPanel_root);
        jPanel_root.setLayout(jPanel_rootLayout);
        jPanel_rootLayout.setHorizontalGroup(
            jPanel_rootLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_rootLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel_rootLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(panel_DSKH, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lb_tenForm, javax.swing.GroupLayout.DEFAULT_SIZE, 780, Short.MAX_VALUE)
                    .addGroup(jPanel_rootLayout.createSequentialGroup()
                        .addComponent(panel_chucnang, javax.swing.GroupLayout.PREFERRED_SIZE, 207, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(panel_cardLayout, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel_rootLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btn_thoat)
                .addGap(25, 25, 25))
        );
        jPanel_rootLayout.setVerticalGroup(
            jPanel_rootLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_rootLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lb_tenForm, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel_rootLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(panel_cardLayout, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addComponent(panel_chucnang, javax.swing.GroupLayout.DEFAULT_SIZE, 310, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(panel_DSKH, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btn_thoat))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel_root, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel_root, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Gui_GhiDanh_root.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Gui_GhiDanh_root.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Gui_GhiDanh_root.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Gui_GhiDanh_root.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Gui_GhiDanh_root().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_thoat;
    private GUI.Gui_GhiDanh_1 gui_GhiDanh_1;
    private GUI.Gui_GhiDanh_2 gui_GhiDanh_2;
    private javax.swing.JLabel jLabel_ten;
    private javax.swing.JPanel jPanel_root;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JLabel lb_dangKiThiXepLop;
    private javax.swing.JLabel lb_ghiNhanTTKH;
    private javax.swing.JLabel lb_lapBC;
    private javax.swing.JLabel lb_lapBC_1;
    private javax.swing.JLabel lb_lapBC_2;
    private javax.swing.JLabel lb_tenForm;
    private javax.swing.JPanel panel_DSKH;
    private javax.swing.JPanel panel_cardLayout;
    private javax.swing.JPanel panel_chucnang;
    private javax.swing.JTable table_KH1;
    // End of variables declaration//GEN-END:variables
}
